package au.edu.unsw.editingtool.db;

import java.sql.SQLException;
import java.util.Hashtable;

import au.edu.unsw.editingtool.global.EditingToolException;

public class DBUserAffiliationMap extends DBManager {
	
	private void setupDBMapping() {
		if (MappingTable.size() > 0)
			return;
		MappingTable.put("UserID", "uid");
		MappingTable.put("AffiliationID", "aou");
		MappingTable.put("Priority", "priority");		
	}
	
	public DBUserAffiliationMap() {
		this.table = "user_affiliation_map";
		this.primaryKeys = new String[]{"UserID","AffiliationID"}; 
		this.setupDBMapping();
	}
	
	public void addMap(Hashtable<String, String> map) throws EditingToolException, ClassNotFoundException, SQLException 
	{
		this.setTable(this.table, "");
		this.setColumnValues(map);		
		this.initDB();
		this.insert(false, true);
		this.clean();
	}
	
	public void deleteMap(Hashtable<String, String> userInfo) throws EditingToolException, ClassNotFoundException, SQLException 
	{
		
	}
	
}
